function draw_start(cxt, r, R, x, y, rot = 72) {
    cxt.beginPath();
    for (let i = 0; i < 5; i++) {
        cxt.lineTo(Math.cos((18 + 72 * i - rot) / 180 * Math.PI) * R + x, -Math.sin((18 + 72 * i - rot) / 180 * Math.PI) * R + y);
        cxt.lineTo(Math.cos((54 + 72 * i - rot) / 180 * Math.PI) * r + x, -Math.sin((54 + 72 * i - rot) / 180 * Math.PI) * r + y);
    }
    cxt.closePath();
    cxt.fill();
    cxt.stroke();
}

function draw_circle(ctx, r, x, y) {
    ctx.beginPath();
    ctx.arc(x, y, r, 0, 2 * Math.PI)

    ctx.fill();
    ctx.stroke();
    ctx.closePath();
}

Array.prototype.shuffle = function () {
    for (let j, x, i = this.length; i; j = parseInt(Math.random() * i), x = this[--i], this[i] = this[j], this[j] = x) {
    }
    return this;
}

CanvasRenderingContext2D.prototype.render = function (cb) {
    this.save()
    try {
        cb.call(this, this)
    } finally {
        this.restore()
    }
}